<template>
	<view>
		<u-navbar :title="title" @leftClick="leftClick" :bgColor="bgColor">
			<view class="u-nav-slot" slot="left">
				<u-icon name="arrow-left" color="#000" size="24"></u-icon>
			</view>
		</u-navbar>
		
		<web-view :webview-styles="webviewStyles" :src="src"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgColor: '#fff',
				title: "",
				src: "",
			};
		},

		onShow() {
			this.UserSignContract()
		},

		methods: {
			leftClick() {
				uni.navigateBack()
			},

			UserSignContract() {
				uni.$u.http.get('/stb.withdraw/apiUserSignContract').then(res => {
					if (res.code == 0) {
						return uni.$u.toast(res.msg);
					}
					this.title = res.data.title;
					this.src = res.data.url;
				}).catch(err => console.log(err.msg))
			},
		}
	}
</script>

<style lang="scss">
	iframe {
		width: 100%;
		padding-top: 44px;
	}
</style>